home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1998 January: Technology Seed / Jan. '98 ATS.toast / QuickTime™ 3.0b11 / QTPublicInterfaces / CIncludes / Components.h < prev    next >
Encoding:
C/C++ Source or Header  |  1998-01-12  |  19.3 KB  |  572 lines  |  [TEXT/MPS ]

  1. /*
  2.      File:        Components.h
  3.  
  4.      Contains:    QuickTime interfaces
  5.  
  6.      Version:    Technology:    
  7.                  Release:    QuickTime 3.0 Beta
  8.  
  9.      Copyright:    © 1990-1997 by Apple Computer, Inc., all rights reserved
  10.  
  11.      Bugs?:        Please include the the file and version information (from above) with
  12.                  the problem description.  Developers belonging to one of the Apple
  13.                  developer programs can submit bug reports to:
  14.  
  15.                      devsupport@apple.com
  16.  
  17. */
  18. #ifndef __COMPONENTS__
  19. #define __COMPONENTS__
  20.  
  21. #ifndef __ERRORS__
  22. #include <Errors.h>
  23. #endif
  24. #ifndef __MACTYPES__
  25. #include <MacTypes.h>
  26. #endif
  27. #ifndef __MIXEDMODE__
  28. #include <MixedMode.h>
  29. #endif
  30. #ifndef __CODEFRAGMENTS__
  31. #include <CodeFragments.h>
  32. #endif
  33.  
  34.  
  35.  
  36. #if PRAGMA_ONCE
  37. #pragma once
  38. #endif
  39.  
  40. #ifdef __cplusplus
  41. extern "C" {
  42. #endif
  43.  
  44. #if PRAGMA_IMPORT
  45. #pragma import on
  46. #endif
  47.  
  48. #if PRAGMA_STRUCT_ALIGN
  49.     #pragma options align=mac68k
  50. #elif PRAGMA_STRUCT_PACKPUSH
  51.     #pragma pack(push, 2)
  52. #elif PRAGMA_STRUCT_PACK
  53.     #pragma pack(2)
  54. #endif
  55.  
  56.  
  57. enum {
  58.     kAppleManufacturer            = FOUR_CHAR_CODE('appl'),        /* Apple supplied components */
  59.     kComponentResourceType        = FOUR_CHAR_CODE('thng'),        /* a components resource type */
  60.     kComponentAliasResourceType    = FOUR_CHAR_CODE('thga')        /* component alias resource type */
  61. };
  62.  
  63.  
  64. enum {
  65.     kAnyComponentType            = 0,
  66.     kAnyComponentSubType        = 0,
  67.     kAnyComponentManufacturer    = 0,
  68.     kAnyComponentFlagsMask        = 0
  69. };
  70.  
  71.  
  72. enum {
  73.     cmpWantsRegisterMessage        = 1L << 31,
  74.     cmpIsComponentAlias            = 1L << 28
  75. };
  76.  
  77.  
  78. enum {
  79.     kComponentOpenSelect        = -1,                            /* ComponentInstance for this open */
  80.     kComponentCloseSelect        = -2,                            /* ComponentInstance for this close */
  81.     kComponentCanDoSelect        = -3,                            /* selector # being queried */
  82.     kComponentVersionSelect        = -4,                            /* no params */
  83.     kComponentRegisterSelect    = -5,                            /* no params */
  84.     kComponentTargetSelect        = -6,                            /* ComponentInstance for top of call chain */
  85.     kComponentUnregisterSelect    = -7,                            /* no params */
  86.     kComponentGetMPWorkFunctionSelect = -8                        /* some params */
  87. };
  88.  
  89. /* Component Resource Extension flags */
  90.  
  91. enum {
  92.     componentDoAutoVersion        = (1 << 0),
  93.     componentWantsUnregister    = (1 << 1),
  94.     componentAutoVersionIncludeFlags = (1 << 2),
  95.     componentHasMultiplePlatforms = (1 << 3),
  96.     componentLoadResident        = (1 << 4)
  97. };
  98.  
  99.  
  100.  
  101. /* Set Default Component flags */
  102.  
  103. enum {
  104.     defaultComponentIdentical    = 0,
  105.     defaultComponentAnyFlags    = 1,
  106.     defaultComponentAnyManufacturer = 2,
  107.     defaultComponentAnySubType    = 4,
  108.     defaultComponentAnyFlagsAnyManufacturer = (defaultComponentAnyFlags + defaultComponentAnyManufacturer),
  109.     defaultComponentAnyFlagsAnyManufacturerAnySubType = (defaultComponentAnyFlags + defaultComponentAnyManufacturer + defaultComponentAnySubType)
  110. };
  111.  
  112. /* RegisterComponentResource flags */
  113.  
  114. enum {
  115.     registerComponentGlobal        = 1,
  116.     registerComponentNoDuplicates = 2,
  117.     registerComponentAfterExisting = 4,
  118.     registerComponentAliasesOnly = 8
  119. };
  120.  
  121.  
  122.  
  123. enum {
  124.     unresolvedComponentDLLErr    = -3004
  125. };
  126.  
  127.  
  128. struct ComponentDescription {
  129.     OSType                             componentType;                /* A unique 4-byte code indentifying the command set */
  130.     OSType                             componentSubType;            /* Particular flavor of this instance */
  131.     OSType                             componentManufacturer;        /* Vendor indentification */
  132.     unsigned long                     componentFlags;                /* 8 each for Component,Type,SubType,Manuf/revision */
  133.     unsigned long                     componentFlagsMask;            /* Mask for specifying which flags to consider in search, zero during registration */
  134. };
  135. typedef struct ComponentDescription        ComponentDescription;
  136.  
  137.  
  138. struct ResourceSpec {
  139.     OSType                             resType;                    /* 4-byte code     */
  140.     short                             resID;                        /*              */
  141. };
  142. typedef struct ResourceSpec                ResourceSpec;
  143.  
  144. struct ComponentResource {
  145.     ComponentDescription             cd;                            /* Registration parameters */
  146.     ResourceSpec                     component;                    /* resource where Component code is found */
  147.     ResourceSpec                     componentName;                /* name string resource */
  148.     ResourceSpec                     componentInfo;                /* info string resource */
  149.     ResourceSpec                     componentIcon;                /* icon resource */
  150. };
  151. typedef struct ComponentResource        ComponentResource;
  152. typedef ComponentResource *                ComponentResourcePtr;
  153. typedef ComponentResourcePtr *            ComponentResourceHandle;
  154.  
  155. struct ComponentPlatformInfo {
  156.     long                             componentFlags;                /* flags of Component */
  157.     ResourceSpec                     component;                    /* resource where Component code is found */
  158.     short                             platformType;                /* gestaltSysArchitecture result */
  159. };
  160. typedef struct ComponentPlatformInfo    ComponentPlatformInfo;
  161.  
  162. struct ComponentResourceExtension {
  163.     long                             componentVersion;            /* version of Component */
  164.     long                             componentRegisterFlags;        /* flags for registration */
  165.     short                             componentIconFamily;        /* resource id of Icon Family */
  166. };
  167. typedef struct ComponentResourceExtension ComponentResourceExtension;
  168.  
  169. struct ComponentPlatformInfoArray {
  170.     long                             count;
  171.     ComponentPlatformInfo             platformArray[1];
  172. };
  173. typedef struct ComponentPlatformInfoArray ComponentPlatformInfoArray;
  174.  
  175. struct ExtComponentResource {
  176.     ComponentDescription             cd;                            /* registration parameters */
  177.     ResourceSpec                     component;                    /* resource where Component code is found */
  178.     ResourceSpec                     componentName;                /* name string resource */
  179.     ResourceSpec                     componentInfo;                /* info string resource */
  180.     ResourceSpec                     componentIcon;                /* icon resource */
  181.     long                             componentVersion;            /* version of Component */
  182.     long                             componentRegisterFlags;        /* flags for registration */
  183.     short                             componentIconFamily;        /* resource id of Icon Family */
  184.     long                             count;                        /* elements in platformArray */
  185.     ComponentPlatformInfo             platformArray[1];
  186. };
  187. typedef struct ExtComponentResource        ExtComponentResource;
  188.  
  189. struct ComponentAliasResource {
  190.     ComponentResource                 cr;                            /* Registration parameters */
  191.     ComponentDescription             aliasCD;                    /* component alias description */
  192. };
  193. typedef struct ComponentAliasResource    ComponentAliasResource;
  194. /*  Structure received by Component:        */
  195.  
  196. struct ComponentParameters {
  197.     UInt8                             flags;                        /* call modifiers: sync/async, deferred, immed, etc */
  198.     UInt8                             paramSize;                    /* size in bytes of actual parameters passed to this call */
  199.     short                             what;                        /* routine selector, negative for Component management calls */
  200.     long                             params[1];                    /* actual parameters for the indicated routine */
  201. };
  202. typedef struct ComponentParameters        ComponentParameters;
  203.  
  204. struct ComponentRecord {
  205.     long                             data[1];
  206. };
  207. typedef struct ComponentRecord            ComponentRecord;
  208.  
  209. typedef ComponentRecord *                Component;
  210.  
  211. struct ComponentInstanceRecord {
  212.     long                             data[1];
  213. };
  214. typedef struct ComponentInstanceRecord    ComponentInstanceRecord;
  215.  
  216. typedef ComponentInstanceRecord *        ComponentInstance;
  217.  
  218. struct RegisteredComponentRecord {
  219.     long                             data[1];
  220. };
  221. typedef struct RegisteredComponentRecord RegisteredComponentRecord;
  222.  
  223. typedef RegisteredComponentRecord *        RegisteredComponentPtr;
  224.  
  225. struct RegisteredComponentInstanceRecord {
  226.     long                             data[1];
  227. };
  228. typedef struct RegisteredComponentInstanceRecord RegisteredComponentInstanceRecord;
  229.  
  230. typedef RegisteredComponentInstanceRecord * RegisteredComponentInstancePtr;
  231. typedef long                             ComponentResult;
  232.  
  233. enum {
  234.     platform68k                    = 1,                            /* platform type (response from gestaltSysArchitecture) */
  235.     platformPowerPC                = 2,
  236.     platformInterpreted            = 3,
  237.     platformWin32                = 4
  238. };
  239.  
  240.  
  241. enum {
  242.     mpWorkFlagDoWork            = (1 << 0),
  243.     mpWorkFlagDoCompletion        = (1 << 1),
  244.     mpWorkFlagCopyWorkBlock        = (1 << 2),
  245.     mpWorkFlagDontBlock            = (1 << 3),
  246.     mpWorkFlagGetProcessorCount    = (1 << 4),
  247.     mpWorkFlagGetIsRunning        = (1 << 6)
  248. };
  249.  
  250.  
  251. struct ComponentMPWorkFunctionHeaderRecord {
  252.     UInt32                             headerSize;
  253.     UInt32                             recordSize;
  254.     UInt32                             workFlags;
  255.     UInt16                             processorCount;
  256.     UInt8                             unused;
  257.     UInt8                             isRunning;
  258. };
  259. typedef struct ComponentMPWorkFunctionHeaderRecord ComponentMPWorkFunctionHeaderRecord;
  260. typedef ComponentMPWorkFunctionHeaderRecord * ComponentMPWorkFunctionHeaderRecordPtr;
  261. typedef CALLBACK_API( ComponentResult , ComponentMPWorkFunctionProcPtr )(void *globalRefCon, ComponentMPWorkFunctionHeaderRecordPtr header);
  262. typedef CALLBACK_API( ComponentResult , ComponentRoutineProcPtr )(ComponentParameters *cp, Handle componentStorage);
  263. typedef STACK_UPP_TYPE(ComponentMPWorkFunctionProcPtr)             ComponentMPWorkFunctionUPP;
  264. typedef STACK_UPP_TYPE(ComponentRoutineProcPtr)                 ComponentRoutineUPP;
  265. /*
  266.     The parameter list for each ComponentFunction is unique. It is 
  267.     therefore up to users to create the appropriate procInfo for their 
  268.     own ComponentFunctions where necessary.
  269. */
  270.  
  271. typedef UniversalProcPtr                 ComponentFunctionUPP;
  272. #if TARGET_RT_MAC_CFM
  273. /* 
  274.     CallComponentUPP is a global variable exported from InterfaceLib.
  275.     It is the ProcPtr passed to CallUniversalProc to manually call a component function.
  276. */
  277. extern UniversalProcPtr CallComponentUPP;
  278. #endif
  279.  
  280. #define ComponentCallNow( callNumber, paramSize ) \
  281.     FIVEWORDINLINE( 0x2F3C,paramSize,callNumber,0x7000,0xA82A )
  282.  
  283. /********************************************************
  284. *                                                        *
  285. *                  APPLICATION LEVEL CALLS                    *
  286. *                                                        *
  287. ********************************************************/
  288. /********************************************************
  289. * Component Database Add, Delete, and Query Routines 
  290. ********************************************************/
  291. EXTERN_API( Component )
  292. RegisterComponent                (ComponentDescription *    cd,
  293.                                  ComponentRoutineUPP     componentEntryPoint,
  294.                                  short                     global,
  295.                                  Handle                 componentName,
  296.                                  Handle                 componentInfo,
  297.                                  Handle                 componentIcon)                        TWOWORDINLINE(0x7001, 0xA82A);
  298.  
  299. EXTERN_API( Component )
  300. RegisterComponentResource        (ComponentResourceHandle  cr,
  301.                                  short                     global)                                TWOWORDINLINE(0x7012, 0xA82A);
  302.  
  303. EXTERN_API( OSErr )
  304. UnregisterComponent                (Component                 aComponent)                            TWOWORDINLINE(0x7002, 0xA82A);
  305.  
  306. EXTERN_API( Component )
  307. FindNextComponent                (Component                 aComponent,
  308.                                  ComponentDescription *    looking)                            TWOWORDINLINE(0x7004, 0xA82A);
  309.  
  310. EXTERN_API( long )
  311. CountComponents                    (ComponentDescription *    looking)                            TWOWORDINLINE(0x7003, 0xA82A);
  312.  
  313. EXTERN_API( OSErr )
  314. GetComponentInfo                (Component                 aComponent,
  315.                                  ComponentDescription *    cd,
  316.                                  Handle                 componentName,
  317.                                  Handle                 componentInfo,
  318.                                  Handle                 componentIcon)                        TWOWORDINLINE(0x7005, 0xA82A);
  319.  
  320. EXTERN_API( long )
  321. GetComponentListModSeed            (void)                                                        TWOWORDINLINE(0x7006, 0xA82A);
  322.  
  323. EXTERN_API( long )
  324. GetComponentTypeModSeed            (OSType                 componentType)                        TWOWORDINLINE(0x702C, 0xA82A);
  325.  
  326. /********************************************************
  327. * Component Instance Allocation and dispatch routines 
  328. ********************************************************/
  329. EXTERN_API( OSErr )
  330. OpenAComponent                    (Component                 aComponent,
  331.                                  ComponentInstance *    ci)                                    TWOWORDINLINE(0x702D, 0xA82A);
  332.  
  333. EXTERN_API( ComponentInstance )
  334. OpenComponent                    (Component                 aComponent)                            TWOWORDINLINE(0x7007, 0xA82A);
  335.  
  336. EXTERN_API( OSErr )
  337. CloseComponent                    (ComponentInstance         aComponentInstance)                    TWOWORDINLINE(0x7008, 0xA82A);
  338.  
  339. EXTERN_API( OSErr )
  340. GetComponentInstanceError        (ComponentInstance         aComponentInstance)                    TWOWORDINLINE(0x700A, 0xA82A);
  341.  
  342. /********************************************************
  343. *                                                        *
  344. *                      CALLS MADE BY COMPONENTS              *
  345. *                                                        *
  346. ********************************************************/
  347. /********************************************************
  348. * Component Management routines
  349. ********************************************************/
  350. EXTERN_API( void )
  351. SetComponentInstanceError        (ComponentInstance         aComponentInstance,
  352.                                  OSErr                     theError)                            TWOWORDINLINE(0x700B, 0xA82A);
  353.  
  354. EXTERN_API( long )
  355. GetComponentRefcon                (Component                 aComponent)                            TWOWORDINLINE(0x7010, 0xA82A);
  356.  
  357. EXTERN_API( void )
  358. SetComponentRefcon                (Component                 aComponent,
  359.                                  long                     theRefcon)                            TWOWORDINLINE(0x7011, 0xA82A);
  360.  
  361. EXTERN_API( short )
  362. OpenComponentResFile            (Component                 aComponent)                            TWOWORDINLINE(0x7015, 0xA82A);
  363.  
  364. EXTERN_API( OSErr )
  365. OpenAComponentResFile            (Component                 aComponent,
  366.                                  short *                resRef)                                TWOWORDINLINE(0x702F, 0xA82A);
  367.  
  368. EXTERN_API( OSErr )
  369. CloseComponentResFile            (short                     refnum)                                TWOWORDINLINE(0x7018, 0xA82A);
  370.  
  371. EXTERN_API( OSErr )
  372. GetComponentResource            (Component                 aComponent,
  373.                                  OSType                 resType,
  374.                                  short                     resID,
  375.                                  Handle *                theResource)                        TWOWORDINLINE(0x7035, 0xA82A);
  376.  
  377. EXTERN_API( OSErr )
  378. GetComponentIndString            (Component                 aComponent,
  379.                                  Str255                 theString,
  380.                                  short                     strListID,
  381.                                  short                     index)                                TWOWORDINLINE(0x7036, 0xA82A);
  382.  
  383. EXTERN_API( Component )
  384. ResolveComponentAlias            (Component                 aComponent)                            TWOWORDINLINE(0x7020, 0xA82A);
  385.  
  386. /********************************************************
  387. * Component Instance Management routines
  388. ********************************************************/
  389. EXTERN_API( Handle )
  390. GetComponentInstanceStorage        (ComponentInstance         aComponentInstance)                    TWOWORDINLINE(0x700C, 0xA82A);
  391.  
  392. EXTERN_API( void )
  393. SetComponentInstanceStorage        (ComponentInstance         aComponentInstance,
  394.                                  Handle                 theStorage)                            TWOWORDINLINE(0x700D, 0xA82A);
  395.  
  396. EXTERN_API( long )
  397. GetComponentInstanceA5            (ComponentInstance         aComponentInstance)                    TWOWORDINLINE(0x700E, 0xA82A);
  398.  
  399. EXTERN_API( void )
  400. SetComponentInstanceA5            (ComponentInstance         aComponentInstance,
  401.                                  long                     theA5)                                TWOWORDINLINE(0x700F, 0xA82A);
  402.  
  403. EXTERN_API( long )
  404. CountComponentInstances            (Component                 aComponent)                            TWOWORDINLINE(0x7013, 0xA82A);
  405.  
  406. /* useful helper routines for convenient method dispatching */
  407. EXTERN_API( long )
  408. CallComponentFunction            (ComponentParameters *    params,
  409.                                  ComponentFunctionUPP     func)                                TWOWORDINLINE(0x70FF, 0xA82A);
  410.  
  411. EXTERN_API( long )
  412. CallComponentFunctionWithStorage (Handle                 storage,
  413.                                  ComponentParameters *    params,
  414.                                  ComponentFunctionUPP     func)                                TWOWORDINLINE(0x70FF, 0xA82A);
  415.  
  416. #if TARGET_CPU_PPC && TARGET_OS_MAC
  417. EXTERN_API( long )
  418. CallComponentFunctionWithStorageProcInfo (Handle         storage,
  419.                                  ComponentParameters *    params,
  420.                                  ProcPtr                 func,
  421.                                  long                     funcProcInfo);
  422.  
  423. #else
  424. #define CallComponentFunctionWithStorageProcInfo(storage, params, func, funcProcInfo ) CallComponentFunctionWithStorage(storage, params, func)
  425.  
  426. #endif  /* TARGET_CPU_PPC && TARGET_OS_MAC */
  427.  
  428. EXTERN_API( long )
  429. DelegateComponentCall            (ComponentParameters *    originalParams,
  430.                                  ComponentInstance         ci)                                    TWOWORDINLINE(0x7024, 0xA82A);
  431.  
  432. EXTERN_API( OSErr )
  433. SetDefaultComponent                (Component                 aComponent,
  434.                                  short                     flags)                                TWOWORDINLINE(0x701E, 0xA82A);
  435.  
  436. EXTERN_API( ComponentInstance )
  437. OpenDefaultComponent            (OSType                 componentType,
  438.                                  OSType                 componentSubType)                    TWOWORDINLINE(0x7021, 0xA82A);
  439.  
  440. EXTERN_API( OSErr )
  441. OpenADefaultComponent            (OSType                 componentType,
  442.                                  OSType                 componentSubType,
  443.                                  ComponentInstance *    ci)                                    TWOWORDINLINE(0x702E, 0xA82A);
  444.  
  445. EXTERN_API( Component )
  446. CaptureComponent                (Component                 capturedComponent,
  447.                                  Component                 capturingComponent)                    TWOWORDINLINE(0x701C, 0xA82A);
  448.  
  449. EXTERN_API( OSErr )
  450. UncaptureComponent                (Component                 aComponent)                            TWOWORDINLINE(0x701D, 0xA82A);
  451.  
  452. EXTERN_API( long )
  453. RegisterComponentResourceFile    (short                     resRefNum,
  454.                                  short                     global)                                TWOWORDINLINE(0x7014, 0xA82A);
  455.  
  456. EXTERN_API( OSErr )
  457. GetComponentIconSuite            (Component                 aComponent,
  458.                                  Handle *                iconSuite)                            TWOWORDINLINE(0x7029, 0xA82A);
  459.  
  460.  
  461. /********************************************************
  462. *                                                        *
  463. *              Direct calls to the Components                *
  464. *                                                        *
  465. ********************************************************/
  466. /* Old style names*/
  467.  
  468. EXTERN_API( long )
  469. ComponentFunctionImplemented    (ComponentInstance         ci,
  470.                                  short                     ftnNumber)                            FIVEWORDINLINE(0x2F3C, 0x0002, 0xFFFD, 0x7000, 0xA82A);
  471.  
  472. EXTERN_API( long )
  473. GetComponentVersion                (ComponentInstance         ci)                                    FIVEWORDINLINE(0x2F3C, 0x0000, 0xFFFC, 0x7000, 0xA82A);
  474.  
  475. EXTERN_API( long )
  476. ComponentSetTarget                (ComponentInstance         ci,
  477.                                  ComponentInstance         target)                                FIVEWORDINLINE(0x2F3C, 0x0004, 0xFFFA, 0x7000, 0xA82A);
  478.  
  479. /* New style names*/
  480.  
  481. EXTERN_API( ComponentResult )
  482. CallComponentOpen                (ComponentInstance         ci,
  483.                                  ComponentInstance         self)                                FIVEWORDINLINE(0x2F3C, 0x0004, 0xFFFF, 0x7000, 0xA82A);
  484.  
  485. EXTERN_API( ComponentResult )
  486. CallComponentClose                (ComponentInstance         ci,
  487.                                  ComponentInstance         self)                                FIVEWORDINLINE(0x2F3C, 0x0004, 0xFFFE, 0x7000, 0xA82A);
  488.  
  489. EXTERN_API( ComponentResult )
  490. CallComponentCanDo                (ComponentInstance         ci,
  491.                                  short                     ftnNumber)                            FIVEWORDINLINE(0x2F3C, 0x0002, 0xFFFD, 0x7000, 0xA82A);
  492.  
  493. EXTERN_API( ComponentResult )
  494. CallComponentVersion            (ComponentInstance         ci)                                    FIVEWORDINLINE(0x2F3C, 0x0000, 0xFFFC, 0x7000, 0xA82A);
  495.  
  496. EXTERN_API( ComponentResult )
  497. CallComponentRegister            (ComponentInstance         ci)                                    FIVEWORDINLINE(0x2F3C, 0x0000, 0xFFFB, 0x7000, 0xA82A);
  498.  
  499. EXTERN_API( ComponentResult )
  500. CallComponentTarget                (ComponentInstance         ci,
  501.                                  ComponentInstance         target)                                FIVEWORDINLINE(0x2F3C, 0x0004, 0xFFFA, 0x7000, 0xA82A);
  502.  
  503. EXTERN_API( ComponentResult )
  504. CallComponentUnregister            (ComponentInstance         ci)                                    FIVEWORDINLINE(0x2F3C, 0x0000, 0xFFF9, 0x7000, 0xA82A);
  505.  
  506. EXTERN_API( ComponentResult )
  507. CallComponentGetMPWorkFunction    (ComponentInstance         ci,
  508.                                  ComponentMPWorkFunctionUPP * workFunction,
  509.                                  void **                refCon)                                FIVEWORDINLINE(0x2F3C, 0x0008, 0xFFF8, 0x7000, 0xA82A);
  510.  
  511.  
  512. #if !TARGET_OS_MAC
  513. /* 
  514.         CallComponent is used by ComponentGlue routines to manually call a component function.
  515.      */
  516. EXTERN_API( ComponentResult )
  517. CallComponent                    (ComponentInstance         ci,
  518.                                  ComponentParameters *    cp);
  519.  
  520. #endif  /*  !TARGET_OS_MAC */
  521.  
  522. /* UPP call backs */
  523. enum { uppComponentMPWorkFunctionProcInfo = 0x000003F0 };         /* pascal 4_bytes Func(4_bytes, 4_bytes) */
  524. enum { uppComponentRoutineProcInfo = 0x000003F0 };                 /* pascal 4_bytes Func(4_bytes, 4_bytes) */
  525. #define NewComponentMPWorkFunctionProc(userRoutine)             (ComponentMPWorkFunctionUPP)NewRoutineDescriptor((ProcPtr)(userRoutine), uppComponentMPWorkFunctionProcInfo, GetCurrentArchitecture())
  526. #define NewComponentRoutineProc(userRoutine)                     (ComponentRoutineUPP)NewRoutineDescriptor((ProcPtr)(userRoutine), uppComponentRoutineProcInfo, GetCurrentArchitecture())
  527. #define CallComponentMPWorkFunctionProc(userRoutine, globalRefCon, header)  CALL_TWO_PARAMETER_UPP((userRoutine), uppComponentMPWorkFunctionProcInfo, (globalRefCon), (header))
  528. #define CallComponentRoutineProc(userRoutine, cp, componentStorage)  CALL_TWO_PARAMETER_UPP((userRoutine), uppComponentRoutineProcInfo, (cp), (componentStorage))
  529. /* ProcInfos */
  530.  
  531. /* MixedMode ProcInfo constants for component calls */
  532. enum {
  533.     uppComponentFunctionImplementedProcInfo            = 0x000002F0,
  534.     uppGetComponentVersionProcInfo                    = 0x000000F0,
  535.     uppComponentSetTargetProcInfo                    = 0x000003F0,
  536.     uppCallComponentOpenProcInfo                    = 0x000003F0,
  537.     uppCallComponentCloseProcInfo                    = 0x000003F0,
  538.     uppCallComponentCanDoProcInfo                    = 0x000002F0,
  539.     uppCallComponentVersionProcInfo                    = 0x000000F0,
  540.     uppCallComponentRegisterProcInfo                = 0x000000F0,
  541.     uppCallComponentTargetProcInfo                    = 0x000003F0,
  542.     uppCallComponentUnregisterProcInfo                = 0x000000F0,
  543.     uppCallComponentGetMPWorkFunctionProcInfo        = 0x00000FF0
  544. };
  545.  
  546.  
  547.  
  548.  
  549.  
  550.  
  551.  
  552. #if PRAGMA_STRUCT_ALIGN
  553.     #pragma options align=reset
  554. #elif PRAGMA_STRUCT_PACKPUSH
  555.     #pragma pack(pop)
  556. #elif PRAGMA_STRUCT_PACK
  557.     #pragma pack()
  558. #endif
  559.  
  560. #ifdef PRAGMA_IMPORT_OFF
  561. #pragma import off
  562. #elif PRAGMA_IMPORT
  563. #pragma import reset
  564. #endif
  565.  
  566. #ifdef __cplusplus
  567. }
  568. #endif
  569.  
  570. #endif /* __COMPONENTS__ */
  571.  
  572.